import React, { Component } from 'react';
import {Title} from "./style"

class Footer extends Component {
    state = {
        arr : [
            {
                id:0,
                icon:"icon-dianying",
                name:"电影",
                path:"/home"
            },
            {
                id:1,
                icon:"icon-yingyuan",
                name:"影院",
                path:"/cinema"
            },
            {
                id:2,
                icon:"icon-icnews",
                name:"资讯",
                path:"/home"
            },
            {
                id:3,
                icon:"icon-wode",
                name:"我的",
                path:"/user"
            },
        ]
    }

    goTo=(path,e)=>{
        this.props.history.push({pathname: path})
    }

    render() {
        return (
            <Title>
                <ul>
                    {
                        this.state.arr.map(item=>(
                            <li key={item.id} onClick={(e)=>this.goTo(item.path,e)}>
                                <p className={'iconfont' +  " " + item.icon}></p>
                                <span>{item.name}</span>
                            </li>
                        ))
                    }
                </ul>
            </Title>
        );
    }
}

export default Footer;
